/**
 * Copyright (c) 2009-2010 李冬生(Domsn Lee)
 * Jul 1, 2009 11:24:37 PM  
 * Email: 8971092@qq.com
 * QQ: 8971092
 * All rights reserved
 * 转载请注明版权信息
 */
package com.langsin.crmpro.base;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

/**
 * @author Domsn
 *
 */
public class BaseAction extends ActionSupport
{
	public Logger log = Logger.getLogger(this.getClass());

	public ActionContext getActionContext()
	{
		return ActionContext.getContext();
	}
	
	public void attr(String _param, Object _obj)
	{
		this.getRequest().put(_param, _obj);
	}
	
	public Object attr(String _param)
	{
		return this.getRequest().get(_param);
	}
	
	public Map getRequest()
	{
		return (Map)ActionContext.getContext().get("request");
	}
	
	public HttpServletRequest getHttpRequest()
	{
		return ServletActionContext.getRequest();
	}
	
	public Map getSession()
	{
		return (Map)ActionContext.getContext().getSession();
	}
	
	public HttpSession getHttpSession()
	{
		return ServletActionContext.getRequest().getSession();
	}

}
